{include file="public/header" /}
<style>
    .layui-form-select dl dd.layui-this {
        color: #FF2825 !important;
    }

    .layui-form-select dl dd {
        text-align: center;
    }

    .layui-form-select .layui-input {
        border: none;
        padding-left: 0 !important;
        text-align: right;
        width: 100%;
    }

    .layui-form-select {
        width: 40%;
    }

    .set-list input {
        text-align: right;
    }

    .draw-account {
        display: flex;
        justify-content: space-between;
        text-align: center;
    }

    .mode {
        display: none !important;
    }
</style>
<body class="hide-top bgc">
<div class="draw-container">
    <img src="/static/index/img/icon16.png" alt="">
    <div class="draw-content">
        <div class="draw-hd">
            <i class="layui-icon layui-icon-left"></i> 余额提现
        </div>
        <div class="draw-account">
            <div>
                <p class="price">可提现余额</p>
                <p class="num">￥<span>{$user.assets.currency}</span></p>
            </div>

        </div>
        <form action="{:url('draw/save')}" method="post" class="form layui-form">
            <div class="draw-account-news">
                <p class="title">提现金额</p>
                <div class="draw-price">￥
                    <input type="text" lay-verify="required" lay-reqtext="请输入提现金额" lay-verType="tips"
                           name="money" id="money" placeholder="请输入提现金额" autocomplete="off"
                           onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
                    <p class="all">全部</p>
                </div>
                <div class="flex-layout">提现账户
                    <select name="account" id="account">
                        <option value="currency">余额</option>
                    </select>
                </div>
                <div class="flex-layout">支付密码
                    <input type="password" lay-verify="required" lay-reqtext="请输入支付密码" lay-verType="tips"
                           name="pay_password" placeholder="请输入支付密码" style="text-align: right">
                </div>
            </div>
            <div class="draw-account-to flex-layout">提现至
                <a class="rgt" href="javascript:;">
                    <p class="flex-center">
                        <img src="/static/index/img/icon3.png" alt="" class="mode-img" style="display:none;">
                    </p><span class="mode-text">请选择</span>
                    <i class="layui-icon layui-icon-right"></i>
                </a>
                <input type="hidden" name="mode" id="mode" value=""/>
            </div>

            <p class="save upd-save" lay-submit lay-filter="save" formObj=".form">申请提现</p>

            <a class="save save1 upd-save" href="{:url('draw/record')}">提现记录</a>
        </form>
        <div style="padding-left: 20px;font-size: 13px">
            {:htmlspecialchars_decode(cache('system')['draw_msg'])}
        </div>
    </div>
</div>
</body>
{include file="public/footer"/}
<script>
    $("#money").change(function () {
        var m = parseFloat($(this).val()), r = m - m * parseFloat("{:cache('system')['draw_cost']}"), c = $(".real");
        m ? c.text(r) : c.text('0.00');
    })
    $(".all").click(function (){
        var c = $('#account').val();
        $("#money").val(c === 'currency'?'{$user.assets.currency}':'{$user.assets.bonus}');
    })
    $('.rgt').click(function () {
        layer.open({
            type: 2,
            offset: 'b',
            anim: 'slideUp', // 从下往上
            title: '请选择提现方式',
            shadeClose: true,
            shade: 0.8,
            area: ['100%', '60%'],
            content: '{:url(\'draw/mode\')}?type=choice' //iframe的url
        });
    });
    renderLoad = function (mode,icon,text) {
        $(".mode-img").attr('src',icon).show();
        $(".mode-text").text(text);
        $("#mode").val(mode);
        layer.closeAll();
    }
</script>
</html>